#!/usr/bin/env bash
set -eu
./build-linux --clean "$@"
./build-linux "$@"
set +e
./run --eval 'm5 exit' "$@" || status=$?
# https://stackoverflow.com/questions/4713088/how-to-use-git-bisect/22592593#22592593
if [ "$status" -eq 125 ] || [ "$status" -gt 127 ]; then
  status=1
fi
exit "$status"
